﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hyt.Core;
using Hyt.Core.Security;
using Hyt.Passport.Models;
using Hyt.Passport.Repositories;

namespace Hyt.Passport.Persist
{
    public class OperationRepository : PassportRepository<Operation>, IOperationRepository
    {
        public IQueryable<Operation> GetOperations(QueryOption<Operation> option = null)
        {
            return this.PersistService.GetQuery(option);
        }

        public Operation AddOperation(Operation model)
        {
            return this.PersistService.Add(model);
        }

        public void RemoveOperation(Operation model)
        {
            this.PersistService.Remove(model);
        }

        public void UpdateOperation(Operation model)
        {
            this.PersistService.Update(model);
        }

        public IQueryable<OperationGroup> GetOperationGroups(QueryOption<OperationGroup> option = null)
        {
            return this.PersistService.GetQuery(option);
        }

        public OperationGroup AddOperationGroup(OperationGroup model)
        {
            return this.PersistService.Add(model);
        }

        public void RemoveOperationGroup(OperationGroup model)
        {
            this.PersistService.Remove(model);
        }

        public void UpdateOperationGroup(OperationGroup model)
        {
            this.PersistService.Update(model);
        }
    }
}
